package 静态内部类;

//外部类
public class outer {
    private int a = 1;
    public class iner{
        private int a = 2;
        //内部类
        public void show(){
            int a = 3;
            System.out.println("非静态的方法被调用");
            System.out.println(a);//输出方法体的a,3,即输出局部变量
            System.out.println(this.a);//输出内部类的a,2
            System.out.println(outer.this.a);//输出外部类的a,1
        }
    }
        //静态内部类
    static class iner1{
        public void show(){
            System.out.println("内部类方法被调用");
        }
        public static void show1(){
            System.out.println("静态内部类方法被调用");
        }
    }
}
